cmake_minimum_required(VERSION 3.10)
project(graphics)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SFML_STATIC_LIBRARIES TRUE)
set(root ${CMAKE_CURRENT_LIST_DIR})

set(EXECUTABLE_OUTPUT_PATH  ${CMAKE_CURRENT_LIST_DIR}/bin)
set(CMAKE_PREFIX_PATH "${root}")

include_directories("${root}/include")
# CONFIGURE_DEPENDS 标志会使构建系统检查目录变化，当检测到文件增减时自动重新运行 CMake
file(GLOB SOURCES CONFIGURE_DEPENDS "${root}/src/*.cpp")
message("Sources: ${SOURCES}")

add_compile_definitions("-DSFML_STATIC")
find_package(SFML COMPONENTS Graphics Window System REQUIRED)


add_executable(${PROJECT_NAME} main.cpp ${SOURCES})
target_link_libraries(${PROJECT_NAME} SFML::Graphics SFML::Window SFML::System) #
